import Vue from 'vue'
import App from './App.vue'
import router from './router/index.js'
import store from './store'
import ElementUI from 'element-ui';
import VueCropper from 'vue-cropper'
import VueFullpage from 'vue-fullpage.js'
import cropperImage from "./views/inside/mine/Copper.vue"
import 'element-ui/lib/theme-chalk/index.css';
import  ElementTiptapPlugin  from 'element-tiptap'

import './assets/css/index.css'

Vue.component('cropper-image', cropperImage);
Vue.use(VueCropper)

Vue.use(VueFullpage)
Vue.use(ElementUI)
Vue.config.productionTip = false
Vue.use(ElementTiptapPlugin, {
    lang: 'zh'
})


// 防抖
// 提交以后禁用按钮一段时间，防止重复提交
Vue.directive('noMoreClick', {
  inserted(el, binding) {
      el.addEventListener('click', e => {
          el.classList.add('is-disabled')
          el.disabled = true
          setTimeout(() => {
              el.disabled = false
              el.classList.remove('is-disabled')
          }, 2000) //我这里设置的是2000毫秒也就是2秒
      })
  }
})

new Vue({
  router,
  store,
	render: h => h(App)
}).$mount('#app')
